﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;
using System.ComponentModel.Composition;

namespace WaterRevenueMS.Componnent.Data
{
    [Export(typeof(IUnitOfWork))]
    public class EFUnitOfWorkContext:UnitOfWorkContextBase
    {
        /// <summary>
        ///     获取 当前使用的数据访问上下文对象
        /// </summary>
        protected override DbContext Context
        {
            get
            {
                return EFDbContext;
            }
        }

        //[Import("EF", typeof(DbContext))]
        //private Lazy<EFDbContext> EFDbContext
        //{
        //    get;set;
        //}

        [Import("EF",typeof(DbContext))]
        public EFDbContext EFDbContext { get; set; }

    }
}
